package jbit.dao.impl;
import java.io.Serializable;
import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import jbit.dao.EmployeeDao;
import jbit.entity.Employee;
public class EmployeeDaoHibImpl extends HibernateDaoSupport implements EmployeeDao{
	
	public void update(Employee employee){
		super.getHibernateTemplate().update(employee);
	}
	
	public Employee get(Serializable id){
		return (Employee)super.getHibernateTemplate().get(Employee.class, id);
	}
	
	public List<Employee> find(Employee condition){
		return getHibernateTemplate().find(
				"from Employee e where e.name=? and e.password=?",
				new Object[]{condition.getName(),condition.getPassword()});
	}
}
